.class Lcom/brixd/niceapp/community/activity/AlbumActivity$7;
.super Ljava/lang/Object;
.source "AlbumActivity.java"

# interfaces
.implements Landroid/app/LoaderManager$LoaderCallbacks;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/brixd/niceapp/community/activity/AlbumActivity;->initPictures(J)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Ljava/lang/Object;",
        "Landroid/app/LoaderManager$LoaderCallbacks",
        "<",
        "Landroid/database/Cursor;",
        ">;"
    }
.end annotation


# instance fields
.field final synthetic this$0:Lcom/brixd/niceapp/community/activity/AlbumActivity;

.field final synthetic val$columns:[Ljava/lang/String;

.field final synthetic val$selectionArgs:[Ljava/lang/String;


# direct methods
.method constructor <init>(Lcom/brixd/niceapp/community/activity/AlbumActivity;[Ljava/lang/String;[Ljava/lang/String;)V
    .registers 4
    .param p1, "this$0"    # Lcom/brixd/niceapp/community/activity/AlbumActivity;

    .prologue
    .line 218
    iput-object p1, p0, Lcom/brixd/niceapp/community/activity/AlbumActivity$7;->this$0:Lcom/brixd/niceapp/community/activity/AlbumActivity;

    iput-object p2, p0, Lcom/brixd/niceapp/community/activity/AlbumActivity$7;->val$columns:[Ljava/lang/String;

    iput-object p3, p0, Lcom/brixd/niceapp/community/activity/AlbumActivity$7;->val$selectionArgs:[Ljava/lang/String;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public onCreateLoader(ILandroid/os/Bundle;)Landroid/content/Loader;
    .registers 10
    .param p1, "id"    # I
    .param p2, "args"    # Landroid/os/Bundle;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(I",
            "Landroid/os/Bundle;",
            ")",
            "Landroid/content/Loader",
            "<",
            "Landroid/database/Cursor;",
            ">;"
        }
    .end annotation

    .prologue
    .line 222
    new-instance v0, Landroid/content/CursorLoader;

    iget-object v1, p0, Lcom/brixd/niceapp/community/activity/AlbumActivity$7;->this$0:Lcom/brixd/niceapp/community/activity/AlbumActivity;

    # invokes: Lcom/brixd/niceapp/community/activity/AlbumActivity;->getContext()Landroid/content/Context;
    invoke-static {v1}, Lcom/brixd/niceapp/community/activity/AlbumActivity;->access$1500(Lcom/brixd/niceapp/community/activity/AlbumActivity;)Landroid/content/Context;

    move-result-object v1

    sget-object v2, Landroid/provider/MediaStore$Images$Media;->EXTERNAL_CONTENT_URI:Landroid/net/Uri;

    iget-object v3, p0, Lcom/brixd/niceapp/community/activity/AlbumActivity$7;->val$columns:[Ljava/lang/String;

    const-string v4, "bucket_id=?"

    iget-object v5, p0, Lcom/brixd/niceapp/community/activity/AlbumActivity$7;->val$selectionArgs:[Ljava/lang/String;

    const-string v6, "date_modified DESC "

    invoke-direct/range {v0 .. v6}, Landroid/content/CursorLoader;-><init>(Landroid/content/Context;Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)V

    return-object v0
.end method

.method public onLoadFinished(Landroid/content/Loader;Landroid/database/Cursor;)V
    .registers 11
    .param p2, "data"    # Landroid/database/Cursor;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/content/Loader",
            "<",
            "Landroid/database/Cursor;",
            ">;",
            "Landroid/database/Cursor;",
            ")V"
        }
    .end annotation

    .prologue
    .line 227
    .local p1, "loader":Landroid/content/Loader;, "Landroid/content/Loader<Landroid/database/Cursor;>;"
    if-eqz p2, :cond_81

    invoke-interface {p2}, Landroid/database/Cursor;->getCount()I

    move-result v4

    if-lez v4, :cond_81

    .line 229
    new-instance v3, Ljava/util/ArrayList;

    invoke-direct {v3}, Ljava/util/ArrayList;-><init>()V

    .line 231
    .local v3, "pictures":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Lcom/brixd/niceapp/community/model/PictureModel;>;"
    :cond_d
    :goto_d
    invoke-interface {p2}, Landroid/database/Cursor;->moveToNext()Z

    move-result v4

    if-eqz v4, :cond_66

    .line 232
    const-string v4, "_data"

    invoke-static {p2, v4}, Lcom/brixd/niceapp/db/DBHelper;->getString(Landroid/database/Cursor;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    .line 234
    .local v1, "imagePath":Ljava/lang/String;
    new-instance v0, Ljava/io/File;

    invoke-direct {v0, v1}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 235
    .local v0, "imageFile":Ljava/io/File;
    invoke-virtual {v0}, Ljava/io/File;->exists()Z

    move-result v4

    if-eqz v4, :cond_d

    invoke-virtual {v0}, Ljava/io/File;->length()J

    move-result-wide v4

    const-wide/16 v6, 0x0

    cmp-long v4, v4, v6

    if-lez v4, :cond_d

    .line 236
    new-instance v2, Lcom/brixd/niceapp/community/model/PictureModel;

    invoke-direct {v2}, Lcom/brixd/niceapp/community/model/PictureModel;-><init>()V

    .line 237
    .local v2, "picture":Lcom/brixd/niceapp/community/model/PictureModel;
    const-string v4, "_id"

    invoke-static {p2, v4}, Lcom/brixd/niceapp/db/DBHelper;->getLong(Landroid/database/Cursor;Ljava/lang/String;)J

    move-result-wide v4

    invoke-virtual {v2, v4, v5}, Lcom/brixd/niceapp/community/model/PictureModel;->setId(J)V

    .line 238
    const-string v4, "_display_name"

    invoke-static {p2, v4}, Lcom/brixd/niceapp/db/DBHelper;->getString(Landroid/database/Cursor;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v2, v4}, Lcom/brixd/niceapp/community/model/PictureModel;->setName(Ljava/lang/String;)V

    .line 239
    invoke-virtual {v2, v1}, Lcom/brixd/niceapp/community/model/PictureModel;->setImageLocalPath(Ljava/lang/String;)V

    .line 240
    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    const-string v5, "file://"

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v2}, Lcom/brixd/niceapp/community/model/PictureModel;->getImageLocalPath()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v2, v4}, Lcom/brixd/niceapp/community/model/PictureModel;->setImageUriPath(Ljava/lang/String;)V

    .line 241
    invoke-virtual {v3, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    goto :goto_d

    .line 246
    .end local v0    # "imageFile":Ljava/io/File;
    .end local v1    # "imagePath":Ljava/lang/String;
    .end local v2    # "picture":Lcom/brixd/niceapp/community/model/PictureModel;
    :cond_66
    iget-object v4, p0, Lcom/brixd/niceapp/community/activity/AlbumActivity$7;->this$0:Lcom/brixd/niceapp/community/activity/AlbumActivity;

    # getter for: Lcom/brixd/niceapp/community/activity/AlbumActivity;->mPictures:Ljava/util/ArrayList;
    invoke-static {v4}, Lcom/brixd/niceapp/community/activity/AlbumActivity;->access$800(Lcom/brixd/niceapp/community/activity/AlbumActivity;)Ljava/util/ArrayList;

    move-result-object v4

    invoke-virtual {v4}, Ljava/util/ArrayList;->clear()V

    .line 247
    iget-object v4, p0, Lcom/brixd/niceapp/community/activity/AlbumActivity$7;->this$0:Lcom/brixd/niceapp/community/activity/AlbumActivity;

    # getter for: Lcom/brixd/niceapp/community/activity/AlbumActivity;->mPictures:Ljava/util/ArrayList;
    invoke-static {v4}, Lcom/brixd/niceapp/community/activity/AlbumActivity;->access$800(Lcom/brixd/niceapp/community/activity/AlbumActivity;)Ljava/util/ArrayList;

    move-result-object v4

    invoke-virtual {v4, v3}, Ljava/util/ArrayList;->addAll(Ljava/util/Collection;)Z

    .line 248
    iget-object v4, p0, Lcom/brixd/niceapp/community/activity/AlbumActivity$7;->this$0:Lcom/brixd/niceapp/community/activity/AlbumActivity;

    # getter for: Lcom/brixd/niceapp/community/activity/AlbumActivity;->mAdapter:Lcom/brixd/niceapp/community/adapter/AlbumAdapter;
    invoke-static {v4}, Lcom/brixd/niceapp/community/activity/AlbumActivity;->access$1600(Lcom/brixd/niceapp/community/activity/AlbumActivity;)Lcom/brixd/niceapp/community/adapter/AlbumAdapter;

    move-result-object v4

    invoke-virtual {v4}, Lcom/brixd/niceapp/community/adapter/AlbumAdapter;->notifyDataSetChanged()V

    .line 250
    .end local v3    # "pictures":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Lcom/brixd/niceapp/community/model/PictureModel;>;"
    :cond_81
    return-void
.end method

.method public bridge synthetic onLoadFinished(Landroid/content/Loader;Ljava/lang/Object;)V
    .registers 3

    .prologue
    .line 218
    check-cast p2, Landroid/database/Cursor;

    invoke-virtual {p0, p1, p2}, Lcom/brixd/niceapp/community/activity/AlbumActivity$7;->onLoadFinished(Landroid/content/Loader;Landroid/database/Cursor;)V

    return-void
.end method

.method public onLoaderReset(Landroid/content/Loader;)V
    .registers 2
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/content/Loader",
            "<",
            "Landroid/database/Cursor;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 255
    .local p1, "loader":Landroid/content/Loader;, "Landroid/content/Loader<Landroid/database/Cursor;>;"
    return-void
.end method
